package com.np.xxpermissions1;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.widget.Toast;

import com.np.xxpermissions1.permission.BrightnessObserver;
import com.np.xxpermissions1.permission.PermissionManager;

public class MainActivity extends AppCompatActivity {

    protected BrightnessObserver.Builder m_brightness_builder;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        m_brightness_builder = BrightnessObserver.Builder.onCreate(this);

        PermissionManager.doPermission(this, () -> {
            Toast.makeText(this, "授权成功！", Toast.LENGTH_SHORT).show();

            //***flag***{ 设置屏幕亮度
            m_brightness_builder.onResume();
            //***flag***}

//            //***flag***{ 启动SDK配置日志
//            if (PermissionManager.isStorageEnable(this, false)) {
//                m_sdk_debug.log_setFile(ActivityJump.m_patient.getDataSavePath() + "/" + Define.SDK_LOG_FILEPATH);
//                m_sdk_debug.log_setEnable(true);
//                m_sdk_debug.log_reset();
//            }
//            //***flag***}
//
//            //***flag***{ 探头的拔插检测/配置探头
//            ConfigManager.config(this,
//                    ActivityJump.m_enter_data.m_usb_communication_method ? HS_ProbeCollection.CommunicationMethod.Method_USB : HS_ProbeCollection.CommunicationMethod.Method_WIFI,
//                    this.loadLastPurpose(),
//                    ActivityJump.m_enter_data.m_probe_id,
//                    ActivityJump.m_enter_data.m_identification);
//            //***flag***}
        });
    }
}